package gamePack.gfx;

import gamePack.Game;

import java.awt.Image;
import java.awt.image.BufferedImage;

public class ImageManager {

	private Game game;

	private BufferedImage[] bullet;
	private BufferedImage[] enemy;
	private BufferedImage[] powerUp;

	private BufferedImage[] playerUp, playerDown, playerDownLeft,
			playerDownRight, playerUpRight, playerUpLeft;

	public ImageManager(SpriteSheet ss, Game game) {
		this.game = game;

		playerUp = new BufferedImage[1];
		playerUp[0] = ss.grabImage(2, 0, game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		playerDown = new BufferedImage[1];
		playerDown[0] = ss.grabImage(2, 1,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		playerDownLeft = new BufferedImage[2];
		playerDownLeft[0] = ss.grabImage(1, 1,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());
		playerDownLeft[1] = ss.grabImage(0, 1,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		playerDownRight = new BufferedImage[2];
		playerDownRight[0] = ss.grabImage(3, 1,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());
		playerDownRight[1] = ss.grabImage(4, 1,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		playerUpRight = new BufferedImage[2];
		playerUpRight[0] = ss.grabImage(3, 0,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());
		playerUpRight[1] = ss.grabImage(4, 0,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		playerUpLeft = new BufferedImage[2];
		playerUpLeft[0] = ss.grabImage(1, 0,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());
		playerUpLeft[1] = ss.grabImage(0, 0,
				game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		bullet = new BufferedImage[1];
		bullet[0] = ss.grabImage(5, 0, game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		enemy = new BufferedImage[1];
		enemy[0] = ss.grabImage(5, 1, game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());

		powerUp = new BufferedImage[1];
		powerUp[0] = ss.grabImage(5, 2, game.getTileSize() * game.getScale(),
				game.getTileSize() * game.getScale());
	}

	public BufferedImage[] getPlayerUp() {
		return playerUp;
	}

	public BufferedImage[] getPlayerDown() {
		return playerDown;
	}

	public BufferedImage[] getPlayerDownLeft() {
		return playerDownLeft;
	}

	public BufferedImage[] getPlayerDownRight() {
		return playerDownRight;
	}

	public BufferedImage[] getPlayerUpRight() {
		return playerUpRight;
	}

	public BufferedImage[] getPlayerUpLeft() {
		return playerUpLeft;
	}

	public BufferedImage[] getBullet() {
		return bullet;
	}

	public BufferedImage[] getEnemy() {
		return enemy;
	}

	public BufferedImage[] getPowerUp() {
		return powerUp;
	}

}
